var io = require('socket.io-client');
var socket = io.connect('http://127.0.0.1:3000');
socket.on('connect', function () {
    console.log('connect successed !');

    socket.on('disconnect', () => {
        console.log('user disconnected');
    });
});
//接收服务器端send来的信息
socket.on('message', function (data) {
    //判断服务器发来状态是否成功
    console.log(data);
});